package my.soft.aiteacher.teacher.controller;


import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import my.soft.aiteacher.teacher.pojo.KnowledgeVo;
import my.soft.aiteacher.teacher.service.IKnowledgeService;
import my.soft.aiteacher.utils.R;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 知识点关联 前端控制器
 * </p>
 *
 * @author GMCX
 * @since 2025-06-06
 */
@RestController
@Tag(name = "教师-知识点关联管理", description = "教师-知识点关联管理")
@RequestMapping("/knowledge")
public class KnowledgeController {
    @Resource
    private IKnowledgeService knowledgeService;
    @Operation(summary = "上传", description = "上传")
    @PreAuthorize("hasAnyAuthority('upload:knowledge')")
    @RequestMapping(value = "/upload", method = RequestMethod.POST)
    public R upload(@RequestBody List<KnowledgeVo> knowledgeVo) {
        knowledgeService.upload(knowledgeVo);
        return R.success("ok");
    }
}
